/* MERARY price range filter — catalog toolbar (compact, template-like) */
.price-filter {
  --pf-pink: #ef647e;
  --pf-pink-deep: #e85270;
  --pf-pink-soft: #fff1f5;
  --pf-text: #1f1f1f;
  --pf-muted: #8a8482;
  --pf-border: #efe4e6;
  --pf-white: #fff;
  --pf-shadow: 0 14px 36px rgba(50, 17, 28, 0.1);
  position: relative;
  width: 160px;
  flex: 0 0 auto;
  z-index: 30;
  font-family: Manrope, system-ui, sans-serif;
}

.price-filter__trigger {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #ff4b7b;
  border-radius: 999px;
  background: #fff;
  color: #252122;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(255, 75, 123, 0.08);
}

.price-filter.is-active .price-filter__trigger,
.price-filter.is-open .price-filter__trigger {
  border-color: #ff4b7b;
  color: #252122;
}

.price-filter__trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.price-filter .chev {
  color: #ff4b7b;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.price-filter.is-open .chev {
  transform: rotate(180deg);
}

.price-filter__chevron {
  display: none;
}

.price-filter__popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  left: 0;
  width: 248px; /* чуть шире кнопки «Цена», как на шаблоне */
  padding: 16px 14px 14px;
  border: 1px solid var(--pf-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: var(--pf-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: 0.18s ease;
  box-sizing: border-box;
}

.price-filter__popover::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 22px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid var(--pf-border);
  border-top: 1px solid var(--pf-border);
  transform: rotate(45deg);
}

.price-filter.is-open .price-filter__popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.price-filter__title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 650;
  color: var(--pf-text);
  line-height: 1.25;
}

.price-filter__fields {
  display: grid;
  grid-template-columns: 1fr 16px 1fr;
  gap: 6px;
  align-items: end;
}

.price-field__label {
  display: block;
  margin-bottom: 6px;
  color: var(--pf-muted);
  font-size: 12px;
}

.price-field__control {
  height: 40px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #e8e0e2;
  border-radius: 12px;
  background: #fff;
}

.price-field__control:focus-within {
  border-color: var(--pf-pink);
  box-shadow: 0 0 0 3px rgba(239, 100, 126, 0.1);
}

.price-field__control input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--pf-text);
}

.price-field__control span {
  color: var(--pf-pink);
  font-weight: 600;
  font-size: 13px;
}

.price-filter__dash {
  padding-bottom: 12px;
  color: #aaa;
  text-align: center;
  font-size: 13px;
}

.price-slider {
  position: relative;
  height: 28px;
  margin-top: 14px;
}

.price-slider__track,
.price-slider__range {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 999px;
}

.price-slider__track {
  background: #f0e6e9;
}

.price-slider__range {
  background: linear-gradient(90deg, var(--pf-pink), var(--pf-pink-deep));
}

.price-slider__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  appearance: none;
  pointer-events: none;
}

.price-slider__input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--pf-pink);
  border-radius: 50%;
  background: #fff;
  appearance: none;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(239, 100, 126, 0.16);
}

.price-slider__input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--pf-pink);
  border-radius: 50%;
  background: #fff;
  pointer-events: auto;
  cursor: pointer;
}

.price-slider__ticks {
  display: none; /* как на шаблоне — без подписей шкалы */
}

.price-filter__presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.price-filter__preset {
  height: 38px;
  padding: 0 8px;
  border: 1px solid #e8e0e2;
  border-radius: 12px;
  background: #fff;
  color: #2a2626;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}

.price-filter__preset:hover {
  border-color: #ffc3d2;
  background: var(--pf-pink-soft);
}

.price-filter__preset.is-active {
  border-color: var(--pf-pink);
  color: var(--pf-pink);
  background: #fff7f9;
  box-shadow: inset 0 0 0 1px rgba(239, 100, 126, 0.12);
}

.price-filter__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.price-filter__reset {
  display: none; /* шаблон — только «Применить»; сброс через пресеты/повтор */
}

.price-filter__apply {
  height: 44px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pf-pink), var(--pf-pink-deep));
  color: #fff;
  box-shadow: 0 10px 22px rgba(232, 82, 112, 0.17);
}

.price-filter__apply:hover {
  filter: brightness(0.98);
}

@media (max-width: 600px) {
  body.catalog-exact .price-filter {
    width: 100%;
  }

  body.catalog-exact .price-filter__popover {
    left: 0;
    width: min(280px, 100%);
  }
}
